package main

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func main() {
	engine := gin.Default()
	// 设置 html 的加载目录
	engine.LoadHTMLGlob("./007-no-route/html/*")

	engine.GET("/redirect", func(context *gin.Context) {
		context.Redirect(301, "https://www.baidu.com")
	})

	engine.NoRoute(func(context *gin.Context) {
		context.HTML(http.StatusNotFound, "404.html", nil)
	})

	engine.Run(":9000")
}
